package com.komodo.island.gdx.screen;

import com.badlogic.gdx.graphics.Texture;
import com.badlogic.gdx.graphics.g2d.TextureRegion;
import com.komodo.island.gdx.Art;
import com.komodo.island.gdx.GameDescription;
import com.komodo.island.gdx.Input;
import com.komodo.island.gdx.KomodoIsland;
import com.komodo.island.gdx.Persistence;
import com.komodo.island.gdx.dialog.MapTouristDialog;

public class MapTouristScreen extends MapScreen {

	public MapTouristScreen() {
		super();
		// TODO Auto-generated constructor stub
		ID = Input.SCREEN_TOURIST;
	}
	
	@Override
	public void init(KomodoIsland komodoIsland, Texture texture) {
		// TODO Auto-generated method stub
		super.init(komodoIsland,  texture);
		gameDescDialog = new GameDescription(480, 320, true, this,komodoIsland.factTexture,new TextureRegion(texture, 480, 320+270, 480, 320),komodoIsland);
//		gameDescDialog.init();
		
		this.mapDialog = new MapTouristDialog(480, 320, true, this, texture,komodoIsland);
	}
	
	@Override
	public void onScreenRun() {
		// TODO Auto-generated method stub
		super.onScreenRun();
		
	}
	

	@Override
	public void onScreenLoading() {
		// TODO Auto-generated method stub
		
	}
	@Override
	public void show() {
		// TODO Auto-generated method stub
		super.show();
		if (Persistence.sound) {
			if (komodoIsland.main.isPlaying()){
				komodoIsland.main.stop();
			}else{
				
			}
			if (komodoIsland.tourist.isPlaying()){
				
			}else{
				komodoIsland.tourist.play();
			}
			
		} else {
			komodoIsland.main.stop();
			if (komodoIsland.tourist.isPlaying())
				komodoIsland.tourist.stop();

		}
	}
	
	@Override
	public void hide() {
		// TODO Auto-generated method stub
		super.hide();
		try{
			if (Persistence.sound){
				if (komodoIsland.tourist.isPlaying()){
					komodoIsland.tourist.stop();
				}
			}else{
				
			}
		}catch(Exception e){
			
		}
	}
}
